package com.alks.function.mapper;

import com.alks.entity.data.entity.PcCollectUser2;
import com.alks.entity.data.entity.PcCollectUserDept;
import com.alks.function.data.dto.pcCollectUser.PcCollectUser2DeptDto;
import com.alks.function.data.dto.pcCollectUser.PcCollectUser2Dto;
import com.alks.function.data.request.pcCollectUser.CollectUserRequest;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface PcCollectUserMapper {
    /*查询用户*/
    List<PcCollectUser2Dto> getCollectUser(@Param("companyId") String companyId, @Param("request") CollectUserRequest request);

    /*根据用户查部门*/
    List<PcCollectUser2DeptDto> getDeptByCollectUser(@Param("id") String id);


    /*根据用户名和密码查询用户*//**/
    PcCollectUser2 getCollectUserAndPwd(@Param("companyId") String companyId, @Param("userName") String userName, @Param("password") String password);


    /*添加用户*/
    int addCollectUser(@Param("companyId") String companyId, @Param("request") PcCollectUser2 user);

    /*添加部门*/
    int addCollectDept(@Param("companyId") String companyId, @Param("request") PcCollectUserDept list);

    /*删除用户*/
    int deleteCollectUser(@Param("id") String id);

    /*修改用户*/
    int updateCollectUser(@Param("companyId") String companyId, @Param("request") PcCollectUser2 user);

    /*删除部门*/
    int deleteCollectDeptBatch(@Param("id") String id);

    /*删除采集部门*/
    int deleteCollectDept(@Param("companyId") String companyId, @Param("request") PcCollectUser2DeptDto request);

    /*修改采集部门*/
    int updateCollectDept(@Param("companyId") String companyId, @Param("request") PcCollectUser2DeptDto dept);

    boolean existsDeptNo(String deptNo, int collectUserId);
}
